/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app

  router.get('/home/banners', controller.home.getBanners) // 获得首页轮播图
  router.get('/home/visite', controller.home.getVisitNum) // 获得访问量
  router.get('/admin/home/captcha', controller.home.getCaptcha) // 获得图形验证码 admin
  router.post('/admin/home/addBannesr', controller.home.addBannesr) // 新增轮播图 admin
  router.delete('/admin/home/deleteBanner', controller.home.deleteBanner) // 删除轮播图 admin
  router.post('/admin/home/editBanner', controller.home.editBanner) // 编辑轮播图 admin
  router.post('/admin/home/login', controller.home.login) // 管理员登录 admin
  router.get('/admin/home/exitLogin', controller.home.exitLogin) // 退出登录 admin

  router.get('/share/article', controller.share.getArticleList) // 获得分享文章列表
  router.get('/share/getComment', controller.share.getCommentList) // 根据文章id获得文章评论
  router.post('/share/addComment', controller.share.addComment) // 添加文章评论
  router.get('/share/getLiftRecord', controller.share.getLiftRecord) // 获得随记列表
  router.get('/share/addLikeArticle', controller.share.addLikeArticle) // 给文章点赞
  router.get('/share/addViewArticle', controller.share.addViewArticle) // 增加文章的预览量
  router.get('/admin/share/article', controller.share.getArticleAdminList) // 获得分享文章列表 admin
  router.post('/admin/share/updateArticle', controller.share.updateArticle) // 修改文章内容 admin
  router.post('/admin/share/deleteArticle', controller.share.deleteArticle) // 删除文章内容 admin
  router.post('/admin/share/addArticle', controller.share.addArticle) // 增加文章内容 admin
  router.get('/admin/share/getLiftRecordAdmin', controller.share.getLiftRecordAdmin) // 获得随记列表 admin
  router.delete('/admin/share/deleteLiftRecord', controller.share.deleteLiftRecord) // 获得随记列表 admin
  router.post('/admin/share/updateLiftRecord', controller.share.updateLiftRecord) // 跟新随记列表 admin
  router.post('/admin/share/addLiftRecord', controller.share.addLiftRecord) // 增加随记内容 admin

  router.get('/product/getProductList', controller.product.getProductList) // 获得产品列表
  router.get('/product/getProductDetail', controller.product.getProductDetail) // 获得产品详情
  router.get('/admin/product/getProductListAndDetail', controller.product.getProductListAndDetail) // 获得产品列表和产品详情 admin
  router.post('/admin/product/addProduct', controller.product.addProduct) // 新增产品 admin
  router.post('/admin/product/deleteProduct', controller.product.deleteProduct) // 删除产品信息 admin
  router.post('/admin/product/updateProduct', controller.product.updateProduct) // 修改产品信息 admin

  router.get('/upkeep/getQuestionList', controller.upkeep.getQuestionList) // 获得问题列表
  router.get('/admin/upkeep/getQuestionListAdmin', controller.upkeep.getQuestionListAdmin) // 获得问题列表 admin
  router.get('/admin/upkeep/deleteQuestion', controller.upkeep.deleteQuestion) // 删除问题列表 admin
  router.post('/admin/upkeep/updateQuestion', controller.upkeep.updateQuestion) // 修改问题列表 admin
  router.post('/admin/upkeep/addQuestion', controller.upkeep.addQuestion) // 添加问题列表 admin

  router.post('/admin/upload', controller.upload.upload) // 文件上传
}
